<h3>{{heading|escape}}</h3>

{% if page %}
  {% if page.has_other_pages %}
    {% if page.has_previous %}<a href="?{{prev_qs}}">&lt;=</a>&nbsp;{% endif %}
    {% if page.has_next %}<a href="?{{next_qs}}">=&gt;</a>&nbsp;{% endif %}
  {% endif %} <!-- /page.has_other_pages -->
  <table class="listing">
      <tr>
          <th></th> <th></th> <th></th>
          {% if user.is_authenticated_XXX %}
              <th>owned<br />by</th>
              <th>my<br />collection</th>
          {% endif %}
      </tr>
      {% for edition in page.object_list %}
      <tr class="{%cycle 'odd' 'even' %}">
          <th align="right">{{forloop.counter|add:offset}}</th>
          <td align="center">
              <a href="/pac/{{edition.id}}" title="{{edition}}"><img
                  class="cover" id="cover{{edition.isbn}}"
                  style="display:none;"/></a>
          </td>
          <td>
              <dl>
                  <dt><a href="/pac/{{edition.id}}">{{edition}}</a></dt>
                  <dd>{{edition.creator_names}}</dd>
              </dl>
          </td>
          {% if user.is_authenticated %}
              <!--<td>
                  <tal:owner repeat="item edition/getItems">
                      <a tal:attributes="href
                          string:${view/application_url}/u/${item/owner}/${item/item_id}"
                          tal:content="item/owner" />
                  </tal:owner>
              </td>
              -->
              <td align="center" tal:define="ownedItem python:edition.itemOwnedBy(request.principal.id)">
                  <a tal:attributes="name edition/__name__">
                  <form tal:condition="not:ownedItem"
                      method="post" tal:attributes="action
                      string:${view/application_url}/u/${request/principal/id}/addfrompac">
                      <input type="hidden" name="editionestation_id"
                          tal:attributes="value edition/__name__">
                      <input type="hidden" name="camefrom"
                          tal:attributes="value string:${view/url}#${edition/__name__}">
                      <input type="submit" value="add" title="add to my collection" >
                  </form>
                  <a tal:condition="ownedItem" tal:attributes="href 
                          string:${view/application_url}/u/${request/principal/id}/$ownedItem"
                          >view</a>
                  </a>
              </td>
          {% endif %} <!-- user.is_authenticated -->
      </tr>
      {% endfor %}
  </table>
  
  <script language="javascript"  src="http://books.google.com/books?jscmd=viewapi&callback=ProcessGBSBookThumbnails&bibkeys={{isbn_list}}">
  </script>        
{% endif %} <!-- page -->
